export const column = [
    {
        label: 'ID',
        name: 'id',
    },

    {
        label: '名称',
        name: 'name',
    },
    {
        label: '特征值功能码',
        name: 'characters',
    },

    {
        label: '加速度时域功能码',
        name: 'accelerate',
    },
    {
        label: '轴数',
        name: 'single',
        format: (val) => (val === 1 ? '单轴' : '三轴'),
    },
    {
        label: 'mqtt订阅主题',
        name: 'topic',
    },
    {
        title: '操作',
        name: 'action',
        width: '260',
        buttons: [],
    },
]

export const config = [
    {
        name: 'name',
        type: 'input',
        placeholder: '请输入终端名',
        label: '终端名',
        required: true,
    },
    {
        name: 'characters',
        type: 'input',
        placeholder: '请输入特征值功能码',
        label: '特征值功能码',
    },
    {
        name: 'accelerate',
        type: 'input',
        placeholder: '请输入加速度时域功能码',
        label: '加速度时域功能码',
    },

    {
        name: 'topic',
        type: 'input',
        placeholder: '请输入mqtt订阅主题',
        label: 'mqtt订阅主题',
    },
    {
        name: 'single',
        type: 'switch',
        options: {
            active: { text: '单轴', value: 1 },
            inactive: { text: '三轴', value: 2 },
        },
        label: '轴数',
    },
    {
        name: 'eigenvalue',
        type: 'select_id',
        label: '特征值展示项',
        placeholder: '特征值展示项',
        multiple: true,
        options: [],
    },

    {
        name: 'show',
        type: 'switch',
        options: {
            active: { text: '展示', value: 1 },
            inactive: { text: '不展示', value: 2 },
        },
        label: '图谱和波形特征值',
        onChange: (config, form) => {
            config[7].show = form.show === 1 ? () => true : () => false
            config[8].show = form.show === 1 ? () => true : () => false
        },
    },
    {
        name: 'domain',
        type: 'select_id',
        label: '图谱展示项',
        placeholder: '图谱展示项',
        multiple: true,
        options: [],
    },
    {
        name: 'feature_tag',
        type: 'select_id',
        label: '波形特征值展示项',
        placeholder: '波形特征值展示项',
        multiple: true,
        options: [],
    },
    {
        name: 'sys_eig',
        type: 'select_id',
        label: '指标展示项',
        placeholder: '指标展示项',
        multiple: true,
        options: [],
    },
    {
        name: 'sys_wave',
        type: 'select_s',
        label: '波形展示项',
        placeholder: '波形展示项',
        multiple: true,
        options: [],
        defaultProps: {
            label: 'label',
            value: 'id',
        },
    },
]
